import qs from 'qs';

const http = uni.$u.http

const header = {
	'content-type': 'application/x-www-form-urlencoded'
}

// post 单个参数提交 设置请求头 header:{'content-type':'application/x-www-form-urlencoded'}
// post请求示例 export const postMenu = (params, config = {}) => http.post('/public_api/index', params, config)
// get请求示例 export const getMenu = (data) => http.get('/public_api/index', data)


//获取首页
export const getIndex = (data) => http.get('/index', data)

//微信登录
export const wxLogin = (params, config = {}) => http.post('/wxLogin', params, config)

//获取短信验证码
export const getCode = (params, config = {}) => http.post('/sms/getCode', params, config)

//用户账号登录 1000.账号密码登录 1001.短信注册登录 1002.短信登录
export const doLogin = (params, config = {}) => http.post('/doLogin', params, config)

//退出登录
export const logout = (params, config = {}) => http.post('/logout', params, config)

//获取用户信息
export const getUserInfo = (params, config = {}) => http.post('/userInfo', params, config)

//更新用户资料
export const setUserInfo = (params, config = {}) => http.post('/setUserInfo', params, config)

//获取轮播图
export const getRotations = (params, config = {}) => http.post('/getBanners', params, config)


